/*
============================================================================
 Name        : C$(Basename)Recog from $(Basename)Recog.cpp
 Author      : $(Author)
 Version     :
 Copyright   : $(Copyright)
 Description : The recognizer implementation.
============================================================================
*/
#include <f32file.h>
#ifdef __SERIES60_3X__
#include <ImplementationProxy.h>
#endif /* __SERIES60_3X__ */
#include "$(Basename)Recog.h"

static const TInt K$(Basename)RecogDataTypeCount = 1;
_LIT8(K$(Basename)RecogMimeType, "$(mime)");

C$(Basename)Recog::C$(Basename)Recog() : CApaDataRecognizerType(K$(Basename)RecogDllUid, CApaDataRecognizerType::EHigh)
	{
	iCountDataTypes = K$(Basename)RecogDataTypeCount;
	}

TUint C$(Basename)Recog::PreferredBufSize()
	{
	return 0;
	}

TDataType C$(Basename)Recog::SupportedDataTypeL(TInt /*aIndex*/) const
	{
	return TDataType(K$(Basename)RecogMimeType);
	}

void C$(Basename)Recog::DoRecognizeL(const TDesC& aName, const TDesC8& /*aBuffer*/)
	{
	TParse parse;
	User::LeaveIfError(parse.Set(aName, NULL, NULL));
	_LIT(KDot$(Ext), ".$(ext)");

	if(parse.ExtPresent() && !parse.Ext().CompareF(KDot$(Ext)))
		{
		iConfidence = ECertain;
		iDataType = TDataType(K$(Basename)RecogMimeType);
		}
	}

#ifdef __SERIES60_3X__
const TImplementationProxy ImplementationTable[] = 
	{
	IMPLEMENTATION_PROXY_ENTRY(K$(Basename)RecogImplementationUid, C$(Basename)Recog::CreateRecognizerL)
	};

EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
	{
	aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
	return ImplementationTable;
	}

CApaDataRecognizerType* C$(Basename)Recog::CreateRecognizerL()
	{
	return new(ELeave) C$(Basename)Recog();
	}
#else
GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
	{
	return KErrNone;
	}

EXPORT_C CApaDataRecognizerType* CreateRecognizer()
	{
	return new C$(Basename)Recog();
	}
#endif /* __SERIES60_3X__ */
